package com.jzo2o.customer.controller.agency;


import com.jzo2o.common.utils.UserContext;
import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditAddReqDTO;
import com.jzo2o.customer.model.dto.response.RejectReasonResDTO;
import com.jzo2o.customer.service.IAgencyCertificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController("agencyCertificationAuditController")
@RequestMapping("/agency/agency-certification-audit")
@Api(tags = "机构端 - 机构认证审核相关接口")
@RequiredArgsConstructor
public class AgencyCertificationAuditController {
    private final IAgencyCertificationService agencycertificationtService;
    @PostMapping
    @ApiOperation("机构提交认证申请")
    public void certificationApply(@RequestBody AgencyCertificationAuditAddReqDTO reqDTO) {
        agencycertificationtService.apply(reqDTO);

    }

    @GetMapping("/rejectReason")
    @ApiOperation("查询最新的驳回原因")
    public RejectReasonResDTO queryRejectReason() {
        Long userId = UserContext.currentUserId();
        RejectReasonResDTO dto = agencycertificationtService.queryRejectReason();
        return dto;
    }
}
